package cn.wsalix.admin.form;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Data;
import lombok.EqualsAndHashCode;
import cn.anlaser.form.CommonForm;
import cn.wsalix.admin.entity.SysRole;
import cn.wsalix.admin.entity.SysUser;
import cn.wsalix.admin.status.UserEnum;
import cn.wsalix.admin.type.CodeOperaEnum;
import cn.wsalix.type.UserChangeEnum;
import cn.wsalix.type.UserRegTypeEnum;

@Data
@EqualsAndHashCode(callSuper = false)
public class UserForm extends CommonForm {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1258805177222932063L;
	@NotNull
	@Size(min = 4, max = 12)
	private String username;
	@NotNull
	@Size(min = 2, max = 12)
	private String realname;
	@NotNull
	@Size(min = 4, max = 12)
	private String oldPassword;
	@NotNull
	@Size(min = 4, max = 12)
	private String password;
	@NotNull
	private CodeOperaEnum codeType;
	@NotNull
	private String platform;
	@NotNull
	private String loginWay; // 登陆方式 1，手机密码登陆 2，第三方账号登陆
	@NotNull
	private UserRegTypeEnum regType; // 第三方账号登陆类型

	private String accessToken;
	private String expires_in;

	private String openid;// 第三方账号ID(1,微信 unionID,2,QQ openId 3,新浪 uid)
	@NotNull
	@Size(min = 4, max = 12)
	private String nickname;
	private String gender;
	private String country;
	private String province;
	private String city;
	private String avatar;
	private String unionid;

	private String custNickName; //
	private String custHeadPic; //
	private String custSex; //
	private String custPhone; //
	private String custPassword; //
	private String salt;

	//private Long roleId;
	private Long unRoleId;
	@NotNull
	private String verifyCode;// 验证码
	// @Digits(fraction = 0, integer = 12)

	//
	private String phone;
	private String email;

	private String remark;// 描述
	private String birthday;
	private String sex;

	public void setRegType(UserRegTypeEnum regType) {
		this.regType = regType;
	}

	public void setSex(String sex) {
		this.sex = sex;
		this.gender = sex;
	}

	private UserEnum status;
	// temporary variable
	private SysUser user;
	private boolean create = true;// 是否创建用户,验证码不通过则改为false
	private Long shopId;
	
	private SysRole oldRole;
	private SysRole role;
	private String roleName;
	private Long roleId;//Id
	//
	private UserChangeEnum change;
	@NotNull
	private Long userId;
	
	private int isFocus;
	private int isFriend;//0 非好友 1好友
	private int phones;//0 非好友 1好友
	
	private Long wxUserId;
}

